# Maintainer: Morgan <morganamilo@archlinux.org>

_commit=11a45971fc88e8d49e7bb04089b112c774a32f95
pkgname=cargo-asm
pkgver=0.1.16
pkgrel=1
pkgdesc='Cargo subcommand showing the assembly or llvm-ir generated for Rust code'
url='https://github.com/gnzlbg/cargo-asm'
arch=('loong64' 'x86_64')
license=('MIT' 'APACHE')
depends=('cargo' 'gcc-libs')
makedepends=('git')
source=("git+https://github.com/gnzlbg/cargo-asm#commit=$_commit")
sha512sums=('SKIP')


build() {
  cd ${pkgname}
  cargo build --release --locked --target-dir target
}

package() {
  cd ${pkgname}
  install -Dm 755 target/release/cargo-asm target/release/cargo-llvm-ir -t "${pkgdir}/usr/bin"

  install -Dm 644 readme.md -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 license-mit.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
